<%@ include file="/html/book/init.jsp" %>

<%
	PortletURL updateBookURL = renderResponse.createActionURL();
	updateBookURL.setParameter(ActionRequest.ACTION_NAME, BookConstants.ACTION_UPDATE_BOOK);
	
	BMSBook bmsBook = new BMSBookImpl();
	long bookId = ParamUtil.getLong(request, "bookId");
	
	if (bookId > 01) {
		bmsBook = BMSBookLocalServiceUtil.fetchBMSBook(bookId);
	}
%>

<h3> Add / Edit Form </h3>

<aui:form name="fm" method="POST" action="<%= updateBookURL.toString() %>">
	<aui:input name="bookId" type="hidden" value="<%= bmsBook.getBookId() %>"/>
	<aui:input name="redirectURL" type="hidden" value="<%= renderResponse.createRenderURL().toString() %>"  /> 
	<aui:input name="bookTitle" label="BookTitle:" value="<%= bmsBook.getBookTitle() %>" />
	<aui:input name="author" label="Author:" value="<%= bmsBook.getAuthor() %>" />
	<aui:button type="submit" value="Save"/>
</aui:form>

<br/><a href="<portlet:renderURL/>">&laquo; Go Back</a>